package vn.raz.brainnydefense.object;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

public class GameObject {
	public TextureRegion image;
	public Rectangle rec;
	public Vector2 velocity;
	public int kind;
	public float dropTime = .3f;
	public boolean ischosed;
	public boolean isterminated;
	public boolean isBottomCollision;
	
	public GameObject(TextureRegion image, Rectangle rec, int kind){
		this.image = image;
		this.rec = rec;
		this.kind = kind;
		velocity = new Vector2(0, 0);
	}
	
	public void takeGravityForce(Vector2 gf, float slow, float delta){
		if(isBottomCollision){
			return;
		}
		velocity.x += gf.x*delta/dropTime*slow;
		velocity.y += gf.y*delta/dropTime*slow;
		
		rec.x += velocity.x*delta/dropTime*slow;
		rec.y += velocity.y*delta/dropTime*slow;		
	}
}
